<?php
  session_start();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="html/text; charset=utf-8" />
<title>简易BBS系统</title>
</head>
<body>
<?php
include "head.php";
include "mysql.php";
include "myfunction.php";

$aa=new mysql;
$aa->link("");
$bb=new myfunction;
include "total_info.php";
$note_id=$_GET["note_id"];
$module_id=$_GET["module_id"];
$tijiao=$_POST["huifu"];
if($tijiao=="提交"){
	$content=$_POST["content"];
	$bb->str_to($content);
	$today=date("Y-m-d H-i-s");
	if($_SESSION["user_name"]==""){
		$user_name="游客";
	}else{
		$user_name=$_SESSION["user_name"];
	}
	$query="insert into note_info (up_id,title,content,user_name,time) values ('$note_id','$title','$content','$user_name','$today')";

	if($aa->excu($query)){
		echo "<script lauguage=javascript>alert('回复成功');location.href='note_show.php?module_id=".$module_id."&note_id=".$note_id."';</script>";
	}
}
?>
  <form action="#" method="post">
  <table width="80%" align="center" cellspacing="1" cellpadding="0" border="1">
   <tr>
    <td height="15" width="30%" align="right">标题</td>
    <td align="left" width="70%">回复：<?php echo $bb->note_idtotitle($note_id); ?> </td>
   </tr>
   <tr>
    <td height="60" width="30%" align="right">内容</td>
    <td align="left" width="70%"><textarea cols="50" rows="8" name="content"></textarea> </td>
   </tr>
   <tr>
    <td height="15" width="30%" align="right">发帖人</td>
    <td align="left" width="70%"><?php  if($_SESSION["user_name"]==""){
              echo "游客";
	}else{
	      echo $_SESSION["user_name"];
	}
        
        ?> </td>
   </tr>
   <tr>
    <td height="15" width="30%" align="right">时间</td>
    <td align="left" width="70%">系统将自动登录 </td>
   </tr>
    <tr>
    <td height="15" align="center" colspan="2">
    <input type="submit" name="huifu" value="提交"/>&nbsp;&nbsp;
     <input type="reset" value="重置"/></td>
   </tr>
   </table>
   </form>
   <?php
    include "foot.php";
    ?>
   </body>
   </html>


















